# ${item.getLogicName()}(${item.getCodeName()}) :id=${item.getCodeName()}
<% if(item.getMemo()){ %>\

${item.getMemo()}
<%}%>\
<%
String strPath = "/" + cn.ibizlab.codegen.groovy.util.Inflector.getInstance().pluralize(item.getCodeName()).toLowerCase();
if (item.getPSDEServiceAPIMethods()) {
  item.getPSDEServiceAPIMethods().each{ method ->
  if ( method.getMethodType() == 'DEACTION' || method.getMethodType() == 'FETCH') {
  %>\
## ${method.getLogicName()}

<el-row>
<div style="width: 80px">
<el-alert center title="${method.getRequestMethod()}" <%
if(method.getRequestMethod() == 'GET'){
    out << 'type="success"'
}
if(method.getRequestMethod() == 'POST'){
    out << 'style="background-color: rgba(52, 143, 228, 0.1);color: #348fe4;"'
}
if(method.getRequestMethod() == 'PUT'){
    out << 'type="warning"'
}
if(method.getRequestMethod() == 'DELETE'){
    out << 'type="error"'
}
%> :closable="false" ></el-alert>
</div>
<div style="margin-left:5px;width: calc(100% - 85px)">
<el-alert title="<%out.print(strPath)%><%= method.isNeedResourceKey() ? "/{key}" : "" %><%= method.getRequestPath() ? method.getRequestPath() : "" %>" type="info" :closable="false" ></el-alert>
</div>
</el-row>
<%= method.getDataAccessAction() ? '权限标识：`'+method.getDataAccessAction() +"`" : "" %>
<% if(method.getMemo()){ %>\
${method.getMemo()}
<%}%>\
<%if(method.isNeedResourceKey()){%>
##### 路径参数 {docsify-ignore}
|字段col300|类型col150|备注col400|
|---|---|----|
|key|<%=cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(item.getPSDataEntity().getKeyPSDEField().getStdDataType())%>|<%=item.getPSDataEntity().getKeyPSDEField().getMemo()?item.getPSDataEntity().getKeyPSDEField().getMemo():item.getPSDataEntity().getKeyPSDEField().getLogicName()%>|
<%}%>
<%if(method.getPSDEServiceAPIMethodInput().getType() == 'DTO' || method.getPSDEServiceAPIMethodInput().getType() == 'DTOS'){%>

##### 请求参数 {docsify-ignore}
|字段col300|类型col150|备注col400|
|---|---|----|
<% if (method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields()) {
  method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields().eachWithIndex{ field,index ->
    if(field.getPSDEField() && (field.getPSDEField().getPredefinedType() == 'CREATEMAN'||field.getPSDEField().getPredefinedType() == 'CREATEDATE'||field.getPSDEField().getPredefinedType() == 'UPDATEMAN'||field.getPSDEField().getPredefinedType() == 'UPDATEDATE'))
       return
  %>\
|<el-row justify="space-between"><el-col :span="20">${field.getName().toLowerCase()}</el-col><el-col :span="4" style="text-align:right"><%=field.isAllowEmpty()?'<el-text size="small" type="success">可选</el-text>':''%></el-col> </el-row>\
|<%=cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(field.getStdDataType())%>|<%=field.getMemo()?field.getMemo():field.getLogicName()%>|
<% }} %>
<%}%>
<%if(method.getPSDEServiceAPIMethodInput().getType() == 'DTO' || method.getPSDEServiceAPIMethodInput().getType() == 'DTOS'){%>\

##### 请求示例： {docsify-ignore}
```json
{
<% if (method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO() && method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getType() == 'DEFILTER') { %>\
  "page" : 0,
  "size" : 20,
  "sort" : null,
<% } %>\
<% if (method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO() && method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields()) {
  method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields().eachWithIndex{ field,index -> %>\
  "${field.getName().toLowerCase()}" : null,
<% }} %>\
}
```
<%}%>

<%if(method.getPSDEServiceAPIMethodReturn().getType() != 'VOID'){%>\
##### 响应示例： {docsify-ignore}
```json
<%if(method.getPSDEServiceAPIMethodReturn().getType() == 'DTO' || method.getPSDEServiceAPIMethodReturn().getType() == 'DTOS' || method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE'){%>\
<% if(method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE') { %>[<% } %>
<% if(method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE') { %>  <% } %>{
<% if (method.getPSDEServiceAPIMethodReturn().getPSDEMethodDTO() && method.getPSDEServiceAPIMethodReturn().getPSDEMethodDTO().getPSDEMethodDTOFields()) {
  method.getPSDEServiceAPIMethodReturn().getPSDEMethodDTO().getPSDEMethodDTOFields().eachWithIndex{ field,index -> %>\
<% if(method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE') { %>  <% } %>  "${field.getName().toLowerCase()}" : null,
<% }} %>\
<% if(method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE') { %>  <% } %>}
<% if(method.getPSDEServiceAPIMethodReturn().getType() == 'PAGE') { %>]<% } %>
<% } else if(method.getPSDEServiceAPIMethodReturn().getType() == 'SIMPLE' || method.getPSDEServiceAPIMethodReturn().getType() == 'SIMPLES') { %>\
${cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(method.getPSDEServiceAPIMethodReturn().getStdDataType())}
<% } else if(method.getPSDEServiceAPIMethodReturn().getType() == 'VOID') { %>\
<%}%>\
```
<%}%>\

<% }} %>
<%= ctx.output(item,'/api/other_method/importtemplate.md.tpl') %>
<%= ctx.output(item,'/api/other_method/exportdata.md.tpl') %>
<%= ctx.output(item,'/api/other_method/importdata.md.tpl') %>
<%= ctx.output(item,'/api/other_method/importdata2.md.tpl') %>
<%= ctx.output(item,'/api/other_method/asyncimportdata2.md.tpl') %>
<%= ctx.output(item,'/api/other_method/printdata.md.tpl') %>
<%= ctx.output(item,'/api/other_method/report.md.tpl') %>
<% } %>\

<%if(item.getMinorPSDEServiceAPIRSs()){
  item.getMinorPSDEServiceAPIRSs().each{ rs ->
  strPath = "/" + cn.ibizlab.codegen.groovy.util.Inflector.getInstance().pluralize(item.getCodeName()).toLowerCase();
  strPath = String.format('/%s/{pkey}%s',cn.ibizlab.codegen.groovy.util.Inflector.getInstance().pluralize(rs.getMajorPSDEServiceAPI().getCodeName()).toLowerCase(),strPath)
  %>\

<%    if(rs.getPSDEServiceAPIMethods()){
      rs.getPSDEServiceAPIMethods().each{ method ->
          if ( method.getMethodType() == 'DEACTION' || method.getMethodType() == 'FETCH') {%>\

## 根据${rs.getMajorPSDEServiceAPI().getPSDataEntity().getLogicName()}${method.getLogicName()}

<el-row>
<div style="width: 80px">
<el-alert center title="${method.getRequestMethod()}" <%
if(method.getRequestMethod() == 'GET'){
    out << 'type="success"'
}
if(method.getRequestMethod() == 'POST'){
    out << 'style="background-color: rgba(52, 143, 228, 0.1);color: #348fe4;"'
}
if(method.getRequestMethod() == 'PUT'){
    out << 'type="warning"'
}
if(method.getRequestMethod() == 'DELETE'){
    out << 'type="error"'
}
%> :closable="false" ></el-alert>
</div>
<div style="margin-left:5px;width: calc(100% - 85px)">
<el-alert title="<%out.print(strPath)%><%= method.isNeedResourceKey() ? "/{key}" : "" %><%= method.getRequestPath() ? method.getRequestPath() : "" %>" type="info" :closable="false" ></el-alert>
</div>
</el-row>
<%= (method.getMemo()) ? method.getMemo() : "" %>

##### 路径参数 {docsify-ignore}
|字段col300|类型col150|备注col400|
|---|---|----|
|pkey|<%=cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(rs.getMajorPSDEServiceAPI().getPSDataEntity().getKeyPSDEField().getStdDataType())%>|${rs.getMajorPSDEServiceAPI().getPSDataEntity().getLogicName()}主键|
<%if(method.isNeedResourceKey()){%>\
|key|<%=cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(item.getPSDataEntity().getKeyPSDEField().getStdDataType())%>|<%= (item.getPSDataEntity() && item.getPSDataEntity().getKeyPSDEField()) ? item.getPSDataEntity().getKeyPSDEField().getLogicName() : "主键" %>|
<%}%>

<%if(method.getPSDEServiceAPIMethodInput().getType() == 'DTO' || method.getPSDEServiceAPIMethodInput().getType() == 'DTOS'){%>

##### 请求参数 {docsify-ignore}
|字段col300|类型col150|备注col400|
|---|---|----|
<% if (method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields()) {
  method.getPSDEServiceAPIMethodInput().getPSDEMethodDTO().getPSDEMethodDTOFields().eachWithIndex{ field,index ->
    if(field.getPSDEField() && (field.getPSDEField().getPredefinedType() == 'CREATEMAN'||field.getPSDEField().getPredefinedType() == 'CREATEDATE'||field.getPSDEField().getPredefinedType() == 'UPDATEMAN'||field.getPSDEField().getPredefinedType() == 'UPDATEDATE'))
       return
  %>\
|<el-row justify="space-between"><el-col :span="20">${field.getName().toLowerCase()}</el-col><el-col :span="4" style="text-align:right"><%=field.isAllowEmpty()?'<el-text size="small" type="success">可选</el-text>':''%></el-col> </el-row>\
|<%=cn.ibizlab.codegen.groovy.util.JavaTypeUtil.getJavaType(field.getStdDataType())%>|<%=field.getMemo()?field.getMemo():field.getLogicName()%>|
<% }} %>
<%}%>
<%}}}%>
<%= ctx.output(rs,'/api/other_method/importtemplate.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/exportdata.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/importdata.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/importdata2.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/asyncimportdata2.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/printdata.md.tpl') %>
<%= ctx.output(rs,'/api/other_method/report.md.tpl') %>
<%}}%>

<script>
 const { createApp } = Vue
  createApp({
    data() {
      return {

      }
    },
    methods: {

    }
  }).use(ElementPlus).mount('#app')
</script>